<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'advertising-form',
    'enableAjaxValidation' => false,
    'enableClientValidation' => true,
    'clientOptions' => array(
        'validateOnSubmit' => true
    ),
    'type' => 'horizontal',
    'htmlOptions' => array(
        'enctype'=> 'multipart/form-data'
    )
));
?>
<div class="title">Post Ads</div>

<?php echo $form->errorSummary($model) ?>

<div class="sign-1 in-div">
    <div>
        <h4>Your ad category</h4>
        <?php echo $form->dropDownList($model, 'category_id', CHtml::listData(Category::model()->findAll(array('order'=>'name')), 'category_id', 'name'), array('class' => 'span5')); ?>
    </div>
</div>

<div class="sign-1 in-div">
    <h4>Contact Informations</h4>
    <p><em>All contact information will not be posted and is used for communication between you and buyer.</em></p>
    <div>
        <label>Contact Name *</label>
        <?php echo $form->textField($model, 'author', array('maxlength' => 60)); ?>
    </div>
    <div>
        <label>Email *</label>
        <?php echo $form->textField($model, 'email', array('maxlength' => 60)); ?>
    </div>
    <div>
        <label>Country</label>
        <?php echo $form->dropDownList($model, 'country', CHtml::listData(Country::model()->findAll(array('order' => 'country_name')), 'country_iso', 'country_name'), array('maxlength' => 60)); ?>
    </div>
    <div>
        <label>State</label>
        <?php echo $form->textField($model, 'state', array('maxlength' => 60)); ?>
    </div>

    <div>
        <label>City</label>
        <?php echo $form->textField($model, 'city', array('maxlength' => 60)); ?>
    </div>
</div><!--in-div-->


<div class="sign-1 in-div">
    <div>
        <h4>Type of Product</h4>
        <?php echo $form->dropDownList($model, 'type_id', CHtml::listData(Type::model()->findAll(array('order'=>'name')), 'type_id', 'name')); ?>
    </div>

    <div>
        <label>Manufacturer:</label>
        <?php echo $form->textField($model, 'manufacturer', array('maxlength' => 255)); ?>
    </div>
</div><!--in-div-->


<div class="sign-1 in-div">

    <div style="width:600px; float:none;">
        <label>Price</label>
        <label class="radio inline">
            <input type="radio" value="0" name="priceType" class="price1" <?php if($model->price == '') echo 'checked'; ?> /> All reasonable offers considered
        </label>
        <label class="radio inline">
            <input type="radio" value="1" name="priceType" class="price2" <?php if($model->price != '') echo 'checked'; ?> /> Price
        </label>
        <span class="Show-in" <?php if($model->price == '') echo 'style="display:none;"'; ?>>
            <?php echo $form->textField($model, 'price'); ?>
        </span>
    </div>

    <div class="line-ke" ></div>
    <div>
        <label>Upload picture</label>
        <?php echo CHtml::fileField('image') ?>
    </div>
    <div>
        <label>Duration of post</label>
        <label class="radio inline">
            <input type="radio" value="1W" name="duration" checked="" /> 1 week
        </label>
        <label class="radio inline">
            <input type="radio" value="2W" name="duration" /> 2 weeks
        </label>
        <label class="radio inline">
            <input type="radio" value="1M" name="duration" /> 1 month
        </label>
    </div>
</div><!--in-div-->


<div class="sign-1 in-div">
    <h4>Describe your ad</h4>
    <div>
        <label>Title<span class="star">*</span></label>
        <?php echo $form->textField($model, 'title', array('maxlength' => 255, 'span6')); ?>
    </div>

    <div style="width:500px;">
        <label>Description<span class="star">*</span></label>
        <?php echo $form->textArea($model, 'description', array('rows' => 10, 'cols' => 50, 'class' => 'span6')); ?>
    </div>
</div>

<div class="sign-1 in-div">
    <button type="submit" class="btn btn-warning">Post Ads</button>
</div>
<?php $this->endWidget(); ?>